package com.eascs.o2o.recruit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.eascs.app.dao.JdbcSession;
import com.eascs.o2o.recruit.entity.ApplyForInfoVO;
import com.eascs.o2o.recruit.entity.LoanLinkman;
import com.eascs.o2o.recruit.entity.OfficeForInfoVO;
import com.eascs.o2o.recruit.service.ApplyForInfoService;

@com.alibaba.dubbo.config.annotation.Service
public class ApplyForInfoServiceImpl implements ApplyForInfoService{

	@Autowired
	@Qualifier("wxSession")
	protected JdbcSession jdbcSession;
	
	@Override
	public int saveApplyForInfo(ApplyForInfoVO applyForInfoVO) {
		return jdbcSession.insert(applyForInfoVO);
	}
	@Override
	public int saveOfficeForInfo(OfficeForInfoVO officeForInfoVO) {
		return jdbcSession.insert(officeForInfoVO);
	}
	@Override
	public List<ApplyForInfoVO> findAllApply() {
		// TODO Auto-generated method stub
		return jdbcSession.findAllEntitys(ApplyForInfoVO.class);
	}
	@Override
	public List<OfficeForInfoVO> findAllOffice() {
		// TODO Auto-generated method stub
		return jdbcSession.findAllEntitys(OfficeForInfoVO.class);
	}

	@Override
	public LoanLinkman queryLoanLinkman(OfficeForInfoVO officeForInfoVO) {
		String sql="SELECT id,uname,telphone,oragn,province,city FROM loan_linkman WHERE province = ?";
		return jdbcSession.findEntity(sql, LoanLinkman.class, new Object[]{officeForInfoVO.getProvince()});
	}

}
